package com.bipbip.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bipbip.modelo.MarcaVehiculo;
import com.bipbip.modelo.ModeloVehiculo;
import com.bipbip.modelo.Vehiculo;
import com.bipbip.repositorio.ModeloDAO;

@Service
public class ModeloServiceImpl implements ModeloService {

	@Autowired
	private ModeloDAO modeloDao;

	public List<ModeloVehiculo> getAll() {
		return modeloDao.selectAll();
	}

	public ModeloVehiculo getModelo(Vehiculo vehiculo) {
		return modeloDao.select(vehiculo.getIdModelo());
	}

	public List<ModeloVehiculo> getAllByMarca(Integer marca) {
		return modeloDao.selectBy("idMarca", marca);
	}

}
